<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_header :: common_header(~{::title},~{::link},~{})">
    <title>修改项目 - 项目管理</title>


</head>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-program-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">项目编码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" style="width: 150px"
                       readonly="readonly" th:value="${currentProgramInfo.getProgramId()}"
                       placeholder="" id="programId" name="programId">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>项目名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" style="width: 100%;"
                       th:value="${currentProgramInfo.getProgramName()}"
                       placeholder="" id="programName" name="programName">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>Key：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" style="width: 100%;"
                       th:value="${currentProgramInfo.getProgramKey()}"
                       placeholder="" id="programKey" name="programKey">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span
                    class="c-red">*</span>Secret：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" style="width: 100%;"
                       th:value="${currentProgramInfo.getProgramSecret()}"
                       placeholder="" id="programSecret" name="programSecret">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">项目介绍：</label>
            <div class="formControls col-xs-8 col-sm-9">
					<textarea name="programDes" th:text="${currentProgramInfo.getProgramDes()}"
                              cols="" rows="" class="textarea" placeholder="说点什么..."></textarea>
                <p class="textarea-numberbar">
                    <em class="textarea-length"></em>/2000
                </p>
            </div>
        </div>
        <input id="content" name="content" type="hidden">
        <input type="hidden" th:value="${currentProgramInfo.getCreateTime()}" id="createTime" name="createTime">
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button class="btn btn-primary radius" type="submit">
                    <i class="Hui-iconfont">&#xe632;</i> 保存
                </button>
            </div>
        </div>
    </form>
</article>

<div th:replace="_footer :: foot"></div>
<script type="text/javascript">
    $(function () {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        $(".textarea").Huitextarealength({
            minlength: 0,
            maxlength: 2000,
            exceed: false
        });
        //表单验证
        $("#form-program-add").validate({
            rules: {
                programName: {
                    required: true,
                },
                programKey: {
                    required: true,
                },
                programSecret: {
                    required: true,
                }
            },
            onkeyup: false,
            focusCleanup: false,
            success: "valid",
            submitHandler: function (form) {
                ajaxSubmit();
            }
        });

        function ajaxSubmit() {
            $.ajax({
                asyns: false,
                cache: false,
                type: 'POST',
                data: $('#form-program-add').serialize(),
                url: "updateSave",
                success: function (data) {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
            });
            return false;
        };
    });
</script>

</body>
</html>